
 export const setaddZero = v=>v>10?v:'0'+v
 export const formateDate = (time)=>{
   let date = new Date(time)
   let y = date.getFullYear()
   let M = date.getMonth()+1
   let d = date.getDay()
   let h = date.getHours()
   let m = date.getMinutes()
   let s = date.getSeconds()

let arr=[y,M,d,h,m,s].map(v=>setaddZero(v))
return arr.slice(0,3).join('-') + ' ' + arr.slice(3).join(':')
 }
 export const formateDateYmd = (time)=>{
    let date = new Date(time)
    let y = date.getFullYear()
    let M = date.getMonth()+1
    let d = date.getDay()
  
 
 let arr=[y,M,d].map(v=>setaddZero(v))
 return arr.slice(0,3).join('-') 
  }
  
  export const formateDateHms = (time)=>{
   let date = new Date(time)
 
   let h = date.getHours()
   let m = date.getMinutes()
   let s = date.getSeconds()


let arr=[h,m,s].map(v=>setaddZero(v))
return  arr.slice(0,3).join(':')
 }

 export const threenum=(num)=> {
    var result = [ ], counter = 0;
    num = (num || 0).toString().split('');
    for (var i = num.length - 1; i >= 0; i--) {
        counter++;
        result.unshift(num[i]);
        if (!(counter % 3) && i != 0) { result.unshift(','); }
    }
    return result.join('');
}